//
//  PlayManager.h
//  first app
//
//  Created by 林 小明 on 14-7-10.
//
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

typedef NS_ENUM(NSInteger, PlayerStatus) {
    PlayerStatusPlay = 1,
    PlayerStatusStop = 2,
    PlayerStatusResume = 3
};

@interface PlayManager : NSObject<AVAudioPlayerDelegate>
{
    NSMutableArray *playlist;
    int currentpos;
    
    AVAudioPlayer *player;
    NSMutableDictionary* playStatusInfos;
}

+ (PlayManager *)sharedSingleton;

- (PlayManager *)init;

- (BOOL) setPlayList:(NSMutableArray*)playlist;

- (BOOL) startPlay:(int)pos;

- (void) startPlay;

- (void) stopPlay;

- (BOOL) isPlaying;

- (BOOL) isInit;

- (void) setCurrentTime:(NSTimeInterval)time;

- (NSTimeInterval) getCurrentTime;

- (NSTimeInterval) getDuration;

- (NSString *) getTitle;

- (NSString *) getURL;

@end
